//
//  SettingsView.swift
//  AppleDemo
//
//  Created by Just 花语 on 2025/10/27.
//

import SwiftUI
struct SettingsView: View {
    @Binding var startingPoints: Int
    @Binding var highestScoreWins: Bool
    
    var body: some View{
        VStack(alignment: .leading){
            Text("Game Rules")
                .font(.title)
            Divider()
            Picker("Win condition", selection: $highestScoreWins){
                Text("Higest score wins").tag(true)
                Text("Lowest score wins").tag(false)
            }
            Picker("Starting points",selection: $startingPoints){
                Text("0 Points").tag(0)
                Text("10 Points").tag(10)
                Text("20 Points").tag(20)
            }
        }
        .padding()
        .background(.thickMaterial,in:.rect(cornerRadius: 20.0))
    }
}

#Preview{
    @Previewable @State var points = 10
    @Previewable @State var doesHeightScoreWins = true
    SettingsView(startingPoints: $points,highestScoreWins: $doesHeightScoreWins)
}
